Skip to content

WIP: feat: add riscv64 architecture support#231

Draft
vhaudiquet wants to merge 1 commit into
canonical:mainfrom
vhaudiquet:riscv64-support
Draft

WIP: feat: add riscv64 architecture support#231
vhaudiquet wants to merge 1 commit into
canonical:mainfrom
vhaudiquet:riscv64-support

Conversation

@vhaudiquet

@vhaudiquet vhaudiquet commented Jun 26, 2026

Copy link
Copy Markdown

Overview

Add riscv64 as a supported image architecture, treating it like arm64 (self-contained runner tarball, no system dotnet needed in the image).

The riscv64 GitHub Actions runner tarball is a self-contained build produced from the canonical/github-actions-runner fork (with a riscv64 patch) using the community dotnet-sdk-riscv snap at build time. The produced tarball bundles its own .NET runtime, so — unlike s390x/ ppc64le — no dotnet-runtime apt package is installed in the runner image and riscv64 is excluded from S390X_PPC64LE_ADDITIONAL_APT_PACKAGES.

Changes:

config.py (app):
  - Add RISCV64 to the Arch enum and Arch.to_openstack().
  - Add RUNNER_BINARY_REPO_OVERRIDES to publish the runner tarball from a fork until it is folded into the canonical fork's release pipeline (riscv64 -> vhaudiquet/actions-runner-riscv).

cloud_image.py (app):
  - Map Arch.RISCV64 -> "riscv64" in _get_supported_runner_arch() and add it to SupportedBaseImageArch.

openstack_builder.py (app):
  - _generate_cloud_init_script resolves the runner binary repo via the per-arch override (falling back to canonical/github-actions-runner).
  - Refactor initialize() to iterate over the supported bases, skipping focal for riscv64 (no riscv64 focal cloud image exists on cloud-images.ubuntu.com).

state.py (charm):
  - Add RISCV64 to the charm-side Arch enum, ARCHITECTURES_RISCV64 set, and Arch.from_charm().

charmcraft.yaml:
  - Document riscv64 in the architecture config option description.

Tests:

  • Add riscv64 parametrized cases across the app and charm unit tests.
  • Add test_initialize_riscv64_skips_focal covering the focal skip.

Rationale

RISCV64 hardware will be coming to Toronto and then PS10. We need all Canonical and other software to be fully supported for this. A lot of software is using GitHub runners for tests and build. We need to support GitHub runners, but they themselves depend on .NET which depends on hardware builders. So we need to break the chain by bootstrapping something.

Juju Events Changes

None. No Juju events or hooks were modified. The change is internal to the build logic and configuration parsing.

Module Changes

  • src/state.py
  • app/src/github_runner_image_builder/config.py
  • app/src/github_runner_image_builder/cloud_image.py
  • app/src/github_runner_image_builder/openstack_builder.py

(see full change description above)

Library Changes

None.

Checklist

Still WIP, will try to comply with all requirements above

Add riscv64 as a supported image architecture, treating it like arm64
(self-contained runner tarball, no system dotnet needed in the image).

The riscv64 GitHub Actions runner tarball is a self-contained build
produced from the canonical/github-actions-runner fork (with a riscv64
patch) using the community dotnet-sdk-riscv snap at build time. The
produced tarball bundles its own .NET runtime, so — unlike s390x/
ppc64le — no dotnet-runtime apt package is installed in the runner
image and riscv64 is excluded from S390X_PPC64LE_ADDITIONAL_APT_PACKAGES.

Changes:

config.py (app):
  - Add RISCV64 to the Arch enum and Arch.to_openstack().
  - Add RUNNER_BINARY_REPO_OVERRIDES to publish the runner tarball from
    a fork until it is folded into the canonical fork's release pipeline
    (riscv64 -> vhaudiquet/actions-runner-riscv).

cloud_image.py (app):
  - Map Arch.RISCV64 -> "riscv64" in _get_supported_runner_arch() and
    add it to SupportedBaseImageArch.

openstack_builder.py (app):
  - _generate_cloud_init_script resolves the runner binary repo via the
    per-arch override (falling back to canonical/github-actions-runner).
  - Refactor initialize() to iterate over the supported bases, skipping
    focal for riscv64 (no riscv64 focal cloud image exists on
    cloud-images.ubuntu.com).

state.py (charm):
  - Add RISCV64 to the charm-side Arch enum, ARCHITECTURES_RISCV64 set,
    and Arch.from_charm().

charmcraft.yaml:
  - Document riscv64 in the architecture config option description.

Tests:
  - Add riscv64 parametrized cases across the app and charm unit tests.
  - Add test_initialize_riscv64_skips_focal covering the focal skip.
@vhaudiquet

Copy link
Copy Markdown
Author

The main modifications to allow riscv64 support are:

  • Consume the tarball from a fork, as the main repository only uses GitHub Actions to build the runner software so we will need bootstrapping somewhere
  • Disable Focal images for riscv64, as Focal does not have riscv64 cloud images

Another challenge is that currently OpenStack does not support riscv64, so the change is hard to test fully.

This is still a work in progress and bootstrapping should be the hardest part, once hardware is there we can fully switch to everything supported normally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant